You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

bpmn-moddle

Package Overview
Dependencies
Maintainers
10
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpmn-moddle

A moddle wrapper for BPMN 2.0


Version published
Weekly downloads
63K
decreased by-0.98%
Maintainers
10
Install size
1.12 MB
Created
Weekly downloads
 

Changelog

Source

8.1.0

  • DEPS: update to moddle@6.2.3
  • DEPS: update to moddle-xml@10.1.0

Readme

Source

bpmn-moddle

CI

Read and write BPMN 2.0 diagram files in NodeJS and the browser.

bpmn-moddle uses the BPMN 2.0 meta-model to validate the input and produce correct BPMN 2.0 XML.

Usage

Get the library via npm package. Consume it in NodeJS, via UMD or bundle it using your favorite build tool.

import BpmnModdle from 'bpmn-moddle';

const moddle = new BpmnModdle();

const xmlStr =
  '<?xml version="1.0" encoding="UTF-8"?>' +
  '<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
                     'id="empty-definitions" ' +
                     'targetNamespace="http://bpmn.io/schema/bpmn">' +
  '</bpmn2:definitions>';


const {
  rootElement: definitions
} = await moddle.fromXML(xmlStr);

// update id attribute
definitions.set('id', 'NEW ID');

// add a root element
const bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' });
definitions.get('rootElements').push(bpmnProcess);

// xmlStrUpdated contains new id and the added process
const {
  xml: xmlStrUpdated
} = await moddle.toXML(definitions);

Resources

Building the Project

The tests include XSD schema validation. They required you to have a Java SDK installed and exposed through the JAVA_HOME variable.

# execute the test
npm test

# perform a full build
npm run all

The library is built on top of moddle and moddle-xml.

License

Use under the terms of the MIT license.

Keywords

FAQs

Package last updated on 20 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc